<template>
  <div>
    <div class="actors border-topbottom">
      <div class="tit">演职人员</div>
      <div class="list box">
        <div class="item" v-for="item of actors" :key="item.id">
          <img :src="getImages(item.avatars.small)" alt="">
          <div class="name">{{item.name}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailActors',
  props: {
    actors: Array
  },
  methods: {
    getImages (_url) {
      if (_url !== undefined) {
        let _u = _url.substring(7)
        return 'https://images.weserv.nl/?url=' + _u
      }
    }
  }
}
</script>

<style scoped lang="stylus">
  .actors
    padding: .2rem .3rem
    margin-top: .3rem
    .tit
      height: .7rem
      line-height: .7rem
      color: #808080
      font-size: .28rem
    .list
      margin-left: -2%
      margin-top: -.2rem
      flex-flow: row wrap
      .item
        width: 23%
        margin-left: 2%
        margin-top: .2rem
        img
          width: 100%
          height: auto
          backgournd: #ccc
        .name
          height: .5rem
          line-height: .5rem
          color: #333333
          text-align: center
          font-size: .28rem
          overflow: hidden
          text-overflow:ellipsis
          white-space: nowrap
</style>
